package com.neu.cloudfactory.repository;

import com.neu.cloudfactory.bean.Factory.Factory;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.Optional;

public interface FactoryRepository extends JpaRepository<Factory,Integer> {
    Optional<Factory> findByName(String name);
    Factory findByManagerid(int managerid);
    boolean existsByName(String factoryname);
    Page<Factory> findAllByIdOrNameContainingOrDescriptionContainingOrManagerid(Integer id,String input1,String input2,Integer managerid,Pageable pageable);
}
